<html>
	<head>
	</head>
	<body>

		
		<!-- include SM2 library -->
		<script type="text/javascript" src="script/soundmanager2.js"></script>

		<!-- configure it for your use -->
		<script type="text/javascript">

		soundManager.url = 'swf/'; // directory where SM2 .SWFs live

		/*
		 * Note that SoundManager will determine and append the appropriate .SWF file to the URL,
		 * eg. /path/to/sm2-flash-files/soundmanager2.swf automatically.
		 *
		 * Bonus: Read up on HTML5 audio support, if you're feeling adventurous.
		 * iPad/iPhone and devices without flash installed will always attempt to use it.
		 *
		 * Also, See the flashblock demo when you want to start getting fancy.
		*/

		// disable debug mode after development/testing..
		// soundManager.debugMode = false;

		// The basics: onready() callback

		//gets form data and sets it to play

		var mySound;
		

		
		function URLFromForm (form)
		{
			var TestVar;
			var intFrom;
			var intTo;
			TestVar = form.inputbox1.value;
			intFrom = form.inputbox2.value;
			intTo = form.inputbox3.value;
			playerRun (TestVar, intFrom, intTo)
		}

		function playerRun (songURL, intFrom, intTo) {
						

			soundManager.onready(function(){

				// SM2 has loaded - now you can create and play sounds!

				mySound = new soundManager.createSound({
					id: songURL,
					url: songURL
				// onload: myOnloadHandler,
				// other options here..
			});
			mySound.play({
				from: intFrom,
				to: intTo,

				onstop: function() {
					alert(songURL+ " Done");
					//testResults(songURL);
    				}
			});
			
			
		});


  		}



		// Optional: ontimeout() callback for handling start-up failure

		soundManager.ontimeout(function(){

			alert('Hrmm, SM2 could not start. Flash blocker involved? Show an error, etc.?');

		});

		</script>


 		<FORM NAME="myform" ACTION="" METHOD="GET">Enter something in the box: (try mp3/rain.mp3 or mp3/bass.mp3) <BR>
 	 	<INPUT TYPE="text" NAME="inputbox1"><P>
		<INPUT TYPE="text" NAME="inputbox2"><P>
		<INPUT TYPE="text" NAME="inputbox3"><P>
 		<INPUT TYPE="button" NAME="button" Value="Play" onClick="URLFromForm(this.form)">

		<INPUT TYPE="button" NAME="button2" Value="PlayAuto Song Section" onClick="javascript: playerRun('http://ec2-174-129-71-119.compute-1.amazonaws.com/tags/song1.mp3', '10000', '12000')">
		<br/>
		<p>http://ec2-174-129-71-119.compute-1.amazonaws.com/tags/song1.mp3</p>

	</body>
</html>